package com.me.web.pubsub;

import com.me.web.pubsub.listen.DeviceOtherListen;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 启动类
 *
 * @author bill
 */
@Component
@Slf4j
@Order(2)
public class StartBoot implements ApplicationRunner {



    @Resource
    private DeviceOtherListen otherListen;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        try {

            otherListen.listen();
            log.info("=>设备监听队列启动成功");
        } catch (Exception e) {
            log.error("=>客户端启动失败:{}", e.getMessage(), e);
        }
    }
}
